3.1290 \(\int (a+b \tan ^{-1}(c x)) (d+e \log (1+c^2 x^2)) \, dx\)

Optimal. Leaf size=100 \[ x \left (a+b \tan ^{-1}(c x)\right ) \left (e \log \left (c^2 x^2+1\right )+d\right )+\frac{e \left (a+b \tan ^{-1}(c x)\right )^2}{b c}-2 a e x-\frac{b \left (e \log \left (c^2 x^2+1\right )+d\right )^2}{4 c e}+\frac{b e \log \left (c^2 x^2+1\right )}{c}-2 b e x \tan ^{-1}(c x) \]

[Out]

-2*a*e*x - 2*b*e*x*ArcTan[c*x] + (e*(a + b*ArcTan[c*x])^2)/(b*c) + (b*e*Log[1 + c^2*x^2])/c + x*(a + b*ArcTan[
c*x])*(d + e*Log[1 + c^2*x^2]) - (b*(d + e*Log[1 + c^2*x^2])^2)/(4*c*e)

________________________________________________________________________________________

Rubi [A]  time = 0.189008, antiderivative size = 100, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 8, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.348, Rules used = {5009, 2475, 2390, 2301, 4916, 4846, 260, 4884} \[ x \left (a+b \tan ^{-1}(c x)\right ) \left (e \log \left (c^2 x^2+1\right )+d\right )+\frac{e \left (a+b \tan ^{-1}(c x)\right )^2}{b c}-2 a e x-\frac{b \left (e \log \left (c^2 x^2+1\right )+d\right )^2}{4 c e}+\frac{b e \log \left (c^2 x^2+1\right )}{c}-2 b e x \tan ^{-1}(c x) \]

Antiderivative was successfully verified.

[In]

Int[(a + b*ArcTan[c*x])*(d + e*Log[1 + c^2*x^2]),x]

[Out]

-2*a*e*x - 2*b*e*x*ArcTan[c*x] + (e*(a + b*ArcTan[c*x])^2)/(b*c) + (b*e*Log[1 + c^2*x^2])/c + x*(a + b*ArcTan[
c*x])*(d + e*Log[1 + c^2*x^2]) - (b*(d + e*Log[1 + c^2*x^2])^2)/(4*c*e)

Rule 5009

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[(x*(d + e*Log[f + g*x^2]))/(1 + c^2*x^2), x], x] - Di
st[2*e*g, Int[(x^2*(a + b*ArcTan[c*x]))/(f + g*x^2), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rule 2475

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 2390

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[((f*x)/d)^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 4916

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[(d*f^2)/e, Int[((f*x)^(m - 2)*(a + b*ArcTan[c*x])^p)
/(d + e*x^2), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 4846

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x])^p, x] - Dist[b*c*p, Int[
(x*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^2*x^2), x], x] /; FreeQ[{a, b, c}, x] && IGtQ[p, 0]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 4884

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rubi steps

\begin{align*} \int \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right ) \, dx &=x \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right )-(b c) \int \frac{x \left (d+e \log \left (1+c^2 x^2\right )\right )}{1+c^2 x^2} \, dx-\left (2 c^2 e\right ) \int \frac{x^2 \left (a+b \tan ^{-1}(c x)\right )}{1+c^2 x^2} \, dx\\ &=x \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac{1}{2} (b c) \operatorname{Subst}\left (\int \frac{d+e \log \left (1+c^2 x\right )}{1+c^2 x} \, dx,x,x^2\right )-(2 e) \int \left (a+b \tan ^{-1}(c x)\right ) \, dx+(2 e) \int \frac{a+b \tan ^{-1}(c x)}{1+c^2 x^2} \, dx\\ &=-2 a e x+\frac{e \left (a+b \tan ^{-1}(c x)\right )^2}{b c}+x \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac{b \operatorname{Subst}\left (\int \frac{d+e \log (x)}{x} \, dx,x,1+c^2 x^2\right )}{2 c}-(2 b e) \int \tan ^{-1}(c x) \, dx\\ &=-2 a e x-2 b e x \tan ^{-1}(c x)+\frac{e \left (a+b \tan ^{-1}(c x)\right )^2}{b c}+x \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac{b \left (d+e \log \left (1+c^2 x^2\right )\right )^2}{4 c e}+(2 b c e) \int \frac{x}{1+c^2 x^2} \, dx\\ &=-2 a e x-2 b e x \tan ^{-1}(c x)+\frac{e \left (a+b \tan ^{-1}(c x)\right )^2}{b c}+\frac{b e \log \left (1+c^2 x^2\right )}{c}+x \left (a+b \tan ^{-1}(c x)\right ) \left (d+e \log \left (1+c^2 x^2\right )\right )-\frac{b \left (d+e \log \left (1+c^2 x^2\right )\right )^2}{4 c e}\\ \end{align*}

Mathematica [A]  time = 0.0157285, size = 138, normalized size = 1.38 \[ a e x \log \left (c^2 x^2+1\right )+\frac{2 a e \tan ^{-1}(c x)}{c}+a d x-2 a e x-\frac{b d \log \left (c^2 x^2+1\right )}{2 c}-\frac{b e \log ^2\left (c^2 x^2+1\right )}{4 c}+\frac{b e \log \left (c^2 x^2+1\right )}{c}+b e x \log \left (c^2 x^2+1\right ) \tan ^{-1}(c x)+b d x \tan ^{-1}(c x)+\frac{b e \tan ^{-1}(c x)^2}{c}-2 b e x \tan ^{-1}(c x) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*ArcTan[c*x])*(d + e*Log[1 + c^2*x^2]),x]

[Out]

a*d*x - 2*a*e*x + (2*a*e*ArcTan[c*x])/c + b*d*x*ArcTan[c*x] - 2*b*e*x*ArcTan[c*x] + (b*e*ArcTan[c*x]^2)/c - (b
*d*Log[1 + c^2*x^2])/(2*c) + (b*e*Log[1 + c^2*x^2])/c + a*e*x*Log[1 + c^2*x^2] + b*e*x*ArcTan[c*x]*Log[1 + c^2
*x^2] - (b*e*Log[1 + c^2*x^2]^2)/(4*c)

________________________________________________________________________________________

Maple [A]  time = 0.156, size = 192, normalized size = 1.9 \begin{align*} axd+bd\arctan \left ( cx \right ) x-{\frac{bd\ln \left ({c}^{2}{x}^{2}+1 \right ) }{2\,c}}+{\frac{be}{c}\ln \left ( 2\, \left ( 1+{\frac{-{c}^{2}{x}^{2}+1}{{c}^{2}{x}^{2}+1}} \right ) ^{-1} \right ) }+{\frac{b \left ( \arctan \left ( cx \right ) \right ) ^{2}e}{c}}-{\frac{be}{4\,c} \left ( \ln \left ( 2\, \left ( 1+{\frac{-{c}^{2}{x}^{2}+1}{{c}^{2}{x}^{2}+1}} \right ) ^{-1} \right ) \right ) ^{2}}-2\,bex\arctan \left ( cx \right ) +be\arctan \left ( cx \right ) x\ln \left ( 2\, \left ( 1+{\frac{-{c}^{2}{x}^{2}+1}{{c}^{2}{x}^{2}+1}} \right ) ^{-1} \right ) +axe\ln \left ({c}^{2}{x}^{2}+1 \right ) -2\,aex+2\,{\frac{ae\arctan \left ( cx \right ) }{c}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*arctan(c*x))*(d+e*ln(c^2*x^2+1)),x)

[Out]

a*x*d+b*d*arctan(c*x)*x-1/2/c*b*d*ln(c^2*x^2+1)+1/c*b*e*ln(2/(1+(-c^2*x^2+1)/(c^2*x^2+1)))+1/c*b*arctan(c*x)^2
*e-1/4/c*b*e*ln(2/(1+(-c^2*x^2+1)/(c^2*x^2+1)))^2-2*b*e*x*arctan(c*x)+b*e*arctan(c*x)*x*ln(2/(1+(-c^2*x^2+1)/(
c^2*x^2+1)))+a*x*e*ln(c^2*x^2+1)-2*a*e*x+2*a*e/c*arctan(c*x)

________________________________________________________________________________________

Maxima [A]  time = 1.49276, size = 207, normalized size = 2.07 \begin{align*} -{\left (2 \, c^{2}{\left (\frac{x}{c^{2}} - \frac{\arctan \left (c x\right )}{c^{3}}\right )} - x \log \left (c^{2} x^{2} + 1\right )\right )} b e \arctan \left (c x\right ) -{\left (2 \, c^{2}{\left (\frac{x}{c^{2}} - \frac{\arctan \left (c x\right )}{c^{3}}\right )} - x \log \left (c^{2} x^{2} + 1\right )\right )} a e + a d x + \frac{{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d}{2 \, c} - \frac{{\left (4 \, \arctan \left (c x\right )^{2} + \log \left (c^{2} x^{2} + 1\right )^{2} - 4 \, \log \left (c^{2} x^{2} + 1\right )\right )} b e}{4 \, c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="maxima")

[Out]

-(2*c^2*(x/c^2 - arctan(c*x)/c^3) - x*log(c^2*x^2 + 1))*b*e*arctan(c*x) - (2*c^2*(x/c^2 - arctan(c*x)/c^3) - x
*log(c^2*x^2 + 1))*a*e + a*d*x + 1/2*(2*c*x*arctan(c*x) - log(c^2*x^2 + 1))*b*d/c - 1/4*(4*arctan(c*x)^2 + log
(c^2*x^2 + 1)^2 - 4*log(c^2*x^2 + 1))*b*e/c

________________________________________________________________________________________

Fricas [A]  time = 1.43958, size = 263, normalized size = 2.63 \begin{align*} \frac{4 \, b e \arctan \left (c x\right )^{2} - b e \log \left (c^{2} x^{2} + 1\right )^{2} + 4 \,{\left (a c d - 2 \, a c e\right )} x + 4 \,{\left (2 \, a e +{\left (b c d - 2 \, b c e\right )} x\right )} \arctan \left (c x\right ) + 2 \,{\left (2 \, b c e x \arctan \left (c x\right ) + 2 \, a c e x - b d + 2 \, b e\right )} \log \left (c^{2} x^{2} + 1\right )}{4 \, c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="fricas")

[Out]

1/4*(4*b*e*arctan(c*x)^2 - b*e*log(c^2*x^2 + 1)^2 + 4*(a*c*d - 2*a*c*e)*x + 4*(2*a*e + (b*c*d - 2*b*c*e)*x)*ar
ctan(c*x) + 2*(2*b*c*e*x*arctan(c*x) + 2*a*c*e*x - b*d + 2*b*e)*log(c^2*x^2 + 1))/c

________________________________________________________________________________________

Sympy [A]  time = 2.9767, size = 148, normalized size = 1.48 \begin{align*} \begin{cases} a d x + a e x \log{\left (c^{2} x^{2} + 1 \right )} - 2 a e x + \frac{2 a e \operatorname{atan}{\left (c x \right )}}{c} + b d x \operatorname{atan}{\left (c x \right )} + b e x \log{\left (c^{2} x^{2} + 1 \right )} \operatorname{atan}{\left (c x \right )} - 2 b e x \operatorname{atan}{\left (c x \right )} - \frac{b d \log{\left (c^{2} x^{2} + 1 \right )}}{2 c} - \frac{b e \log{\left (c^{2} x^{2} + 1 \right )}^{2}}{4 c} + \frac{b e \log{\left (c^{2} x^{2} + 1 \right )}}{c} + \frac{b e \operatorname{atan}^{2}{\left (c x \right )}}{c} & \text{for}\: c \neq 0 \\a d x & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*atan(c*x))*(d+e*ln(c**2*x**2+1)),x)

[Out]

Piecewise((a*d*x + a*e*x*log(c**2*x**2 + 1) - 2*a*e*x + 2*a*e*atan(c*x)/c + b*d*x*atan(c*x) + b*e*x*log(c**2*x
**2 + 1)*atan(c*x) - 2*b*e*x*atan(c*x) - b*d*log(c**2*x**2 + 1)/(2*c) - b*e*log(c**2*x**2 + 1)**2/(4*c) + b*e*
log(c**2*x**2 + 1)/c + b*e*atan(c*x)**2/c, Ne(c, 0)), (a*d*x, True))

________________________________________________________________________________________

Giac [B]  time = 1.19696, size = 354, normalized size = 3.54 \begin{align*} \frac{2 \, \pi b c x e \log \left (c^{2} x^{2} + 1\right ) \mathrm{sgn}\left (c\right ) \mathrm{sgn}\left (x\right ) - 4 \, \pi b c x e \mathrm{sgn}\left (c\right ) \mathrm{sgn}\left (x\right ) - 4 \, b c x \arctan \left (\frac{1}{c x}\right ) e \log \left (c^{2} x^{2} + 1\right ) - 6 \, \pi ^{2} b e \mathrm{sgn}\left (c\right ) \mathrm{sgn}\left (x\right ) - 4 \, \pi b \arctan \left (\frac{1}{c x}\right ) e \mathrm{sgn}\left (c\right ) \mathrm{sgn}\left (x\right ) + 4 \, b c d x \arctan \left (c x\right ) + 8 \, b c x \arctan \left (\frac{1}{c x}\right ) e + 4 \, a c x e \log \left (c^{2} x^{2} + 1\right ) - 8 \, \pi a e \mathrm{sgn}\left (c\right ) \mathrm{sgn}\left (x\right ) + 4 \, a c d x + 2 \, \pi ^{2} b e - 8 \, a c x e + 4 \, \pi b \arctan \left (c x\right ) e + 4 \, \pi b \arctan \left (\frac{1}{c x}\right ) e + 4 \, b \arctan \left (\frac{1}{c x}\right )^{2} e - b e \log \left (c^{2} x^{2} + 1\right )^{2} + 8 \, a \arctan \left (c x\right ) e - 2 \, b d \log \left (c^{2} x^{2} + 1\right ) + 4 \, b e \log \left (c^{2} x^{2} + 1\right )}{4 \, c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arctan(c*x))*(d+e*log(c^2*x^2+1)),x, algorithm="giac")

[Out]

1/4*(2*pi*b*c*x*e*log(c^2*x^2 + 1)*sgn(c)*sgn(x) - 4*pi*b*c*x*e*sgn(c)*sgn(x) - 4*b*c*x*arctan(1/(c*x))*e*log(
c^2*x^2 + 1) - 6*pi^2*b*e*sgn(c)*sgn(x) - 4*pi*b*arctan(1/(c*x))*e*sgn(c)*sgn(x) + 4*b*c*d*x*arctan(c*x) + 8*b
*c*x*arctan(1/(c*x))*e + 4*a*c*x*e*log(c^2*x^2 + 1) - 8*pi*a*e*sgn(c)*sgn(x) + 4*a*c*d*x + 2*pi^2*b*e - 8*a*c*
x*e + 4*pi*b*arctan(c*x)*e + 4*pi*b*arctan(1/(c*x))*e + 4*b*arctan(1/(c*x))^2*e - b*e*log(c^2*x^2 + 1)^2 + 8*a
*arctan(c*x)*e - 2*b*d*log(c^2*x^2 + 1) + 4*b*e*log(c^2*x^2 + 1))/c